﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using EShop.BLL;
using EShop.Common;

namespace EShop.Client
{
    public partial class frmMerchandiseTodaySelled : frmBase
    {
        public frmMerchandiseTodaySelled()
        {
            InitializeComponent();
        }

        private void frmMerchandiseTodaySelled_Load(object sender, EventArgs e)
        {
            EShop.BLL.MerchandiseSellBLL oMerchandiseSellBAL = new MerchandiseSellBLL();
            decimal RealAmount = 0;
            DataTable dt = new DataTable();
            oMerchandiseSellBAL.MerchandiseTodaySelled(oShopConfigInfo.LoginID,out RealAmount,out dt);
            lblRealAmount.Text = string.Format(lblRealAmount.Text, FormatManager.FormatDecimal(RealAmount));
            dgvList.Rows.Clear();
            int index = -1;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                index = dgvList.Rows.Add();
                dgvList.Rows[index].Cells["MerchandiseName"].Value = dt.Rows[i]["MerchandiseName"];
                dgvList.Rows[index].Cells["BuyNumber"].Value = dt.Rows[i]["BuyNumber"];
            }
            //dgvList.DataSource = dt;
        }

        private void btnDone_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
